package ua.keeper.query;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class QuerySettings 
{
	
	private SQLiteDatabase db_;
	private String tp_name_;
	/*****************************************************************************************/
	
	QuerySettings(SQLiteDatabase dataBase)
	{
		db_ = dataBase;
    	if (!db_.isOpen())
    	{
    		Log.w("QuerySettings.Init()", "DataBase is not opened!");
    		return;
    	}
    	fillProperties();
	}
    /*****************************************************************************************/
	
	public String getTPName() 
	{
		return tp_name_;
	}
    /*****************************************************************************************/
	
	private void fillProperties()
	{
		Cursor cursor = db_.rawQuery("SELECT tp_name FROM settings", null);

    	if (cursor.getCount() == 0)
    	{
    		Log.w("QuerySettings", "Cursor is empty!");
    	}
    	cursor.moveToFirst();
    	tp_name_ = cursor.getString(0);

        cursor.close();
	}
}
